package com.zzti.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Data
public class SysResult {
    private Integer code;
    private Integer count;
    private Object data;

    public static SysResult success() {
        return new SysResult(0, 0, null);
    }

    public static SysResult success(Object data) {
        return new SysResult(0, 0, data);
    }

    public static SysResult success(Object data, Integer count) {
        return new SysResult(0, count, data);
    }

    public static SysResult fail() {
        return new SysResult(201, 0, null);
    }

    public static SysResult fail(Object obj) {
        return new SysResult(201, 0, obj);
    }
}
